package com.ruoyi.web.controller.hsz.param;

import com.ruoyi.system.domain.HszClazz;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

@Data
public class HszClazzEditParam {
    private Long clazzId;

    /**
     * name
     */
    @NotBlank(message = "名称不能为空")
    @Length(max = 20, message = "名称长度不能超过20个字符")
    private String name;

    /**
     * sort
     */
    private Integer sort = 1;

    /**
     * pid
     */
    private Long pid;

    public HszClazz toDO() {
        HszClazz clazz = new HszClazz();
        clazz.setClazzId(clazzId);
        clazz.setName(name);
        clazz.setSort(sort);
        clazz.setPid(pid);
        return clazz;
    }
}
